From d132b616e2c7b5ad8699b85c845b42cdc496707a Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Mon, 4 Aug 2008 13:52:56 +0000 Subject: [PATCH] move the code of the deprecated gtk_window_set_policy() to a new private 2008-08-04 Michael Natterer * gtk/gtkwindow.c: move the code of the deprecated gtk_window_set_policy() to a new private function gtk_window_set_policy_internal() and call it from gtk_window_set_policy(). (gtk_window_set_resizable): use the new internal function in order to avoid our own deprecated public API. svn path=/trunk/; revision=20965 --- ChangeLog | 10 ++++++++++ gtk/gtkwindow.c | 27 ++++++++++++++++++--------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9784a4d440..283b38f771 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-08-04 Michael Natterer + + * gtk/gtkwindow.c: move the code of the deprecated + gtk_window_set_policy() to a new private function + gtk_window_set_policy_internal() and call it from + gtk_window_set_policy(). + + (gtk_window_set_resizable): use the new internal function in order + to avoid our own deprecated public API. + 2008-08-04 Michael Natterer * gtk/gtkbindings.c: move the code of the deprecated diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 7a19c5a263..b1ffd959ca 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -1532,14 +1532,12 @@ gtk_window_get_default_widget (GtkWindow *window) return window->default_widget; } -void -gtk_window_set_policy (GtkWindow *window, - gboolean allow_shrink, - gboolean allow_grow, - gboolean auto_shrink) +static void +gtk_window_set_policy_internal (GtkWindow *window, + gboolean allow_shrink, + gboolean allow_grow, + gboolean auto_shrink) { - g_return_if_fail (GTK_IS_WINDOW (window)); - window->allow_shrink = (allow_shrink != FALSE); window->allow_grow = (allow_grow != FALSE); @@ -1548,10 +1546,21 @@ gtk_window_set_policy (GtkWindow *window, g_object_notify (G_OBJECT (window), "allow-grow"); g_object_notify (G_OBJECT (window), "resizable"); g_object_thaw_notify (G_OBJECT (window)); - + gtk_widget_queue_resize_no_redraw (GTK_WIDGET (window)); } +void +gtk_window_set_policy (GtkWindow *window, + gboolean allow_shrink, + gboolean allow_grow, + gboolean auto_shrink) +{ + g_return_if_fail (GTK_IS_WINDOW (window)); + + gtk_window_set_policy_internal (window, allow_shrink, allow_grow, auto_shrink); +} + static gboolean handle_keys_changed (gpointer data) { @@ -7003,7 +7012,7 @@ gtk_window_set_resizable (GtkWindow *window, { g_return_if_fail (GTK_IS_WINDOW (window)); - gtk_window_set_policy (window, FALSE, resizable, FALSE); + gtk_window_set_policy_internal (window, FALSE, resizable, FALSE); } /** -- 2.30.2